{% extends "timeline/base.html" %}

{% load timeline_widget_tags %}

{% block title %} 
  {% if pg == "hot" %} 热门 {% endif %}
  {% if pg == "last" %} 最新 {% endif %}
  {% if pg == "recommend" %} 推荐 {% endif %}
  {% if pg == "random" %} 发现 {% endif %}
  {% if pg == "tag" %} 标签 {{ tag.name }} {% endif %}
  -
  似水流年，岁月留痕 - 用时间线来展现历史 
{% endblock %}

{% block container_top %}
<h1>
  {% if pg == "hot" %} 热门 {% endif %}
  {% if pg == "last" %} 最新 {% endif %}
  {% if pg == "recommend" %} 推荐 {% endif %}
  {% if pg == "random" %} 发现 {% endif %}
  {% if pg == "tag" %} 标签 {{ tag.name }} {% endif %}
</h1>
{% endblock %}

{% block sidebar %}
  <div class="sidebar">
    <div class="well">
      <h4>最新时间线</h4>
      <ul>
        {% tl_last %}
      </ul>
    </div>
  </div>
{% endblock %}

{% block content %}
<div class="content">
  <div class="timelines">
    {% load pagination_tags %}
    {% autopaginate timelines %}
    {% for o in timelines %}
    <div class="timeline">
      <div class="pic">
        <img src="{{ o.get_cover_url }}"/>
      </div>
      <div class="info">
        <h3> <a href="{% url timeline_detail o.pk %}">{{o.title}}</a> </h3>
        <div class="extinfo">
          <span>事件: {{o.num_events}}</span>
          <span>浏览: {{o.num_views}}</span>
          <span>回复: {{o.num_replies}}</span>
          <span>by: 
            <a href="{% url userena_profile_detail o.created_by.username %}">
              {{o.created_by}}
            </a>
          </span>
          <span>创建: {{ o.created_on|date:"Y-m-d H:i"}}</span>
        </div>
        {{ o.intro|slice:"160"|linebreaksbr }}{% if o.intro|length > 340 %}...{% endif %} 
      </div>
    </div>
    {% endfor %}
  </div>
  {% paginate %}
</div>
{% endblock %}
